package visao;

import controle.cadHospedeControle;
import controle_pojo.Hospede;
import javax.swing.JOptionPane;
import modelo.dao.cadHospedeDAO;

public class dadosHospede extends javax.swing.JFrame {

    Hospede h = new Hospede();
    private String nome;

    public dadosHospede(int id, String nome) {
        this();
        this.nome = nome;
        cadHospedeDAO hDAO = new cadHospedeDAO();

        h = hDAO.consultarHospede(id);
        carregaHospede(h);
    }

    public dadosHospede() {
        initComponents();

        setLocationRelativeTo(null);
        setResizable(false);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jbAlterar = new javax.swing.JButton();
        jbDeletar = new javax.swing.JButton();
        jbSair = new javax.swing.JButton();
        jTabbedPane4 = new javax.swing.JTabbedPane();
        jpDadosPessoais4 = new javax.swing.JPanel();
        jLabel61 = new javax.swing.JLabel();
        jtfNome = new javax.swing.JTextField();
        jLabel62 = new javax.swing.JLabel();
        jLabel63 = new javax.swing.JLabel();
        jLabel64 = new javax.swing.JLabel();
        jLabel65 = new javax.swing.JLabel();
        jLabel66 = new javax.swing.JLabel();
        jLabel67 = new javax.swing.JLabel();
        jcbSexo = new javax.swing.JComboBox();
        jLabel68 = new javax.swing.JLabel();
        jtfNatural = new javax.swing.JTextField();
        jLabel69 = new javax.swing.JLabel();
        jtfNacion = new javax.swing.JTextField();
        jLabel70 = new javax.swing.JLabel();
        jtfEmail = new javax.swing.JTextField();
        jftfCpf = new javax.swing.JFormattedTextField();
        jftfTelCel = new javax.swing.JFormattedTextField();
        jftfTelResid = new javax.swing.JFormattedTextField();
        jLabel71 = new javax.swing.JLabel();
        jftfNasc = new javax.swing.JFormattedTextField();
        jLabel72 = new javax.swing.JLabel();
        jcbEstadoCivil = new javax.swing.JComboBox();
        jLabel73 = new javax.swing.JLabel();
        jtfBairro = new javax.swing.JTextField();
        jLabel74 = new javax.swing.JLabel();
        jftfCep = new javax.swing.JFormattedTextField();
        jtfEnd = new javax.swing.JTextField();
        jtfRg = new javax.swing.JTextField();
        jLabel75 = new javax.swing.JLabel();
        jtfCidade = new javax.swing.JTextField();
        jcbUF = new javax.swing.JComboBox();
        jpDadosProfissionais = new javax.swing.JPanel();
        jLabel76 = new javax.swing.JLabel();
        jLabel77 = new javax.swing.JLabel();
        jtfEmpresa = new javax.swing.JTextField();
        jtfProfiss = new javax.swing.JTextField();
        jpInformacoesAdicionais = new javax.swing.JPanel();
        jLabel78 = new javax.swing.JLabel();
        jcbPossuiCarro = new javax.swing.JComboBox();
        jLabel79 = new javax.swing.JLabel();
        jLabel80 = new javax.swing.JLabel();
        jtfMM = new javax.swing.JTextField();
        jftfPlaca = new javax.swing.JFormattedTextField();
        jLabel81 = new javax.swing.JLabel();
        jtfCor = new javax.swing.JTextField();
        jpDadosHotelaria = new javax.swing.JPanel();
        jLabel82 = new javax.swing.JLabel();
        jftfDataEnt = new javax.swing.JFormattedTextField();
        jLabel83 = new javax.swing.JLabel();
        jftfDataSaida = new javax.swing.JFormattedTextField();
        jLabel84 = new javax.swing.JLabel();
        jtfApartamento = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jbAlterar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images_icons/123.png"))); // NOI18N
        jbAlterar.setToolTipText("Alterar");
        jbAlterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbAlterarActionPerformed(evt);
            }
        });

        jbDeletar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images_icons/129.png"))); // NOI18N
        jbDeletar.setToolTipText("Deletar");
        jbDeletar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbDeletarActionPerformed(evt);
            }
        });

        jbSair.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images_icons/100.png"))); // NOI18N
        jbSair.setToolTipText("Sair");
        jbSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbSairActionPerformed(evt);
            }
        });

        jpDadosPessoais4.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));

        jLabel61.setText("Nome:");

        jLabel62.setText("Cpf:");

        jLabel63.setText("Rg:");

        jLabel64.setText("Nascimento:");

        jLabel65.setText("Telefone Residencial:");

        jLabel66.setText("Telefone Celular:");

        jLabel67.setText("Sexo:");

        jcbSexo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecione...", "Masculino", "Feminino" }));

        jLabel68.setText("Naturalidade:");

        jLabel69.setText("Nacionalidade:");

        jLabel70.setText("E-mail:");

        try {
            jftfCpf.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        try {
            jftfTelCel.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(0xx##)####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        try {
            jftfTelResid.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(0xx##)####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        jLabel71.setText("Endereço:");

        try {
            jftfNasc.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        jLabel72.setText("Estado Civil:");

        jcbEstadoCivil.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecione...", "Solteiro(a)", "Casado(a)", "Viúvo(a)", "Divorciado(a)", "Separado(a)" }));

        jLabel73.setText("Bairro:");

        jLabel74.setText("CEP:");

        try {
            jftfCep.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#####-###")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        jLabel75.setText("Cidade:");

        jcbUF.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "UF", "AC", "AL", "AM", "AP", "BA", "CE", "DF", "ES", "GO", "MA", "MG", "MS", "MT", "PA", "PB", "PE", "PI", "PR", "RJ", "RN", "RO", "RR", "RS", "SC", "SE", "SP", "TO" }));

        javax.swing.GroupLayout jpDadosPessoais4Layout = new javax.swing.GroupLayout(jpDadosPessoais4);
        jpDadosPessoais4.setLayout(jpDadosPessoais4Layout);
        jpDadosPessoais4Layout.setHorizontalGroup(
            jpDadosPessoais4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpDadosPessoais4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpDadosPessoais4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel66)
                    .addComponent(jLabel74)
                    .addComponent(jLabel73)
                    .addComponent(jLabel71)
                    .addComponent(jLabel70)
                    .addComponent(jLabel68)
                    .addComponent(jLabel67)
                    .addComponent(jLabel61)
                    .addComponent(jLabel62))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpDadosPessoais4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpDadosPessoais4Layout.createSequentialGroup()
                        .addComponent(jtfNatural, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel69)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jtfNacion, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpDadosPessoais4Layout.createSequentialGroup()
                        .addGroup(jpDadosPessoais4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jpDadosPessoais4Layout.createSequentialGroup()
                                .addComponent(jcbSexo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel72)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jcbEstadoCivil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jpDadosPessoais4Layout.createSequentialGroup()
                                .addComponent(jftfCpf, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel63)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtfRg, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel64)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jftfNasc, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jtfNome, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 387, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jpDadosPessoais4Layout.createSequentialGroup()
                                .addComponent(jftfTelCel, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(10, 10, 10)
                                .addComponent(jLabel65)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jftfTelResid, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jtfEmail, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 387, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jpDadosPessoais4Layout.createSequentialGroup()
                                .addComponent(jtfBairro, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel75)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtfCidade, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE)
                                .addComponent(jcbUF, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jtfEnd, javax.swing.GroupLayout.DEFAULT_SIZE, 387, Short.MAX_VALUE)
                            .addComponent(jftfCep, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(117, 117, 117)))
                .addGap(243, 243, 243))
        );
        jpDadosPessoais4Layout.setVerticalGroup(
            jpDadosPessoais4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpDadosPessoais4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpDadosPessoais4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtfNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel61))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpDadosPessoais4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jcbSexo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel72)
                    .addComponent(jcbEstadoCivil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel67))
                .addGap(7, 7, 7)
                .addGroup(jpDadosPessoais4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jftfCpf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel63)
                    .addComponent(jtfRg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel64)
                    .addComponent(jftfNasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel62))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpDadosPessoais4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtfNatural, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel68)
                    .addComponent(jLabel69)
                    .addComponent(jtfNacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(8, 8, 8)
                .addGroup(jpDadosPessoais4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtfEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel70))
                .addGap(8, 8, 8)
                .addGroup(jpDadosPessoais4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel71)
                    .addComponent(jtfEnd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(6, 6, 6)
                .addGroup(jpDadosPessoais4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtfBairro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel73)
                    .addComponent(jLabel75)
                    .addComponent(jtfCidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jcbUF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpDadosPessoais4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel74)
                    .addComponent(jftfCep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpDadosPessoais4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel66)
                    .addComponent(jftfTelResid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel65)
                    .addComponent(jftfTelCel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(21, Short.MAX_VALUE))
        );

        jTabbedPane4.addTab("Dados Pessoais", jpDadosPessoais4);

        jLabel76.setText("Profissão:");

        jLabel77.setText("Empresa:");

        javax.swing.GroupLayout jpDadosProfissionaisLayout = new javax.swing.GroupLayout(jpDadosProfissionais);
        jpDadosProfissionais.setLayout(jpDadosProfissionaisLayout);
        jpDadosProfissionaisLayout.setHorizontalGroup(
            jpDadosProfissionaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpDadosProfissionaisLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpDadosProfissionaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel76, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel77, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jpDadosProfissionaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jtfEmpresa)
                    .addComponent(jtfProfiss, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE))
                .addContainerGap())
        );
        jpDadosProfissionaisLayout.setVerticalGroup(
            jpDadosProfissionaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpDadosProfissionaisLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpDadosProfissionaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel76)
                    .addComponent(jtfProfiss, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpDadosProfissionaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel77)
                    .addComponent(jtfEmpresa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(210, Short.MAX_VALUE))
        );

        jTabbedPane4.addTab("Dados Profissionais", jpDadosProfissionais);

        jLabel78.setText("Possui Carro?");

        jcbPossuiCarro.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Opção...", "Sim", "Não" }));

        jLabel79.setText("Placa:");

        jLabel80.setText("Marca-Modelo:");

        try {
            jftfPlaca.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("***-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        jLabel81.setText("Cor:");

        javax.swing.GroupLayout jpInformacoesAdicionaisLayout = new javax.swing.GroupLayout(jpInformacoesAdicionais);
        jpInformacoesAdicionais.setLayout(jpInformacoesAdicionaisLayout);
        jpInformacoesAdicionaisLayout.setHorizontalGroup(
            jpInformacoesAdicionaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpInformacoesAdicionaisLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpInformacoesAdicionaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel78, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel80, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jpInformacoesAdicionaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpInformacoesAdicionaisLayout.createSequentialGroup()
                        .addComponent(jtfMM, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel81)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfCor, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jpInformacoesAdicionaisLayout.createSequentialGroup()
                        .addComponent(jcbPossuiCarro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel79)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jftfPlaca, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(194, Short.MAX_VALUE))
        );
        jpInformacoesAdicionaisLayout.setVerticalGroup(
            jpInformacoesAdicionaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpInformacoesAdicionaisLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpInformacoesAdicionaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel78)
                    .addComponent(jcbPossuiCarro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel79)
                    .addComponent(jftfPlaca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpInformacoesAdicionaisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel80)
                    .addComponent(jtfMM, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel81)
                    .addComponent(jtfCor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(210, Short.MAX_VALUE))
        );

        jTabbedPane4.addTab("Informações Adicionais", jpInformacoesAdicionais);

        jLabel82.setText("Data de Entrada:");

        try {
            jftfDataEnt.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        jLabel83.setText("Data de Saída:");

        try {
            jftfDataSaida.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        jLabel84.setText("Apartamento: ");

        javax.swing.GroupLayout jpDadosHotelariaLayout = new javax.swing.GroupLayout(jpDadosHotelaria);
        jpDadosHotelaria.setLayout(jpDadosHotelariaLayout);
        jpDadosHotelariaLayout.setHorizontalGroup(
            jpDadosHotelariaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpDadosHotelariaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpDadosHotelariaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel83, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel82, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel84, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jpDadosHotelariaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jtfApartamento, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jftfDataSaida)
                    .addComponent(jftfDataEnt, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(385, Short.MAX_VALUE))
        );
        jpDadosHotelariaLayout.setVerticalGroup(
            jpDadosHotelariaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpDadosHotelariaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpDadosHotelariaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel84)
                    .addComponent(jtfApartamento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpDadosHotelariaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel82)
                    .addComponent(jftfDataEnt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpDadosHotelariaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jftfDataSaida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel83))
                .addContainerGap(184, Short.MAX_VALUE))
        );

        jTabbedPane4.addTab("Dados Hotelaria", jpDadosHotelaria);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(125, 125, 125)
                        .addComponent(jbAlterar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jbDeletar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jbSair))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jTabbedPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 566, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 295, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jbDeletar)
                    .addComponent(jbAlterar)
                    .addComponent(jbSair, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jbAlterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbAlterarActionPerformed

        try {
            cadHospedeControle controle = new cadHospedeControle();

            controle.alterarHospede(
                    jtfNome.getText().toUpperCase(),
                    jcbSexo.getSelectedItem().toString(),
                    jftfCpf.getText(),
                    jtfRg.getText(),
                    jftfNasc.getText(),
                    jtfEmail.getText().toLowerCase(),
                    jtfNatural.getText().toUpperCase(),
                    jtfNacion.getText().toUpperCase(),
                    jcbEstadoCivil.getSelectedItem().toString(),
                    jtfEnd.getText().toUpperCase(),
                    jtfBairro.getText().toUpperCase(),
                    jftfCep.getText(),
                    jtfCidade.getText().toUpperCase(),
                    jcbUF.getSelectedItem().toString(),
                    jftfTelCel.getText(),
                    jftfTelResid.getText(),
                    jtfProfiss.getText().toUpperCase(),
                    jcbPossuiCarro.getSelectedItem().toString(),
                    jftfPlaca.getText().toUpperCase(),
                    jtfMM.getText().toUpperCase(),
                    jtfApartamento.getText(),
                    jftfDataEnt.getText(),
                    jftfDataSaida.getText(),
                    jtfCor.getText().toUpperCase(),
                    jtfEmpresa.getText().toUpperCase());

        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, e);
        }
}//GEN-LAST:event_jbAlterarActionPerformed

    private void jbDeletarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbDeletarActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jbDeletarActionPerformed

    private void jbSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbSairActionPerformed
        // TODO add your handling code here:
        dispose();
}//GEN-LAST:event_jbSairActionPerformed

    private void carregaHospede(Hospede h) {

        jtfNome.setText(h.getNome());
        jcbSexo.setSelectedItem(h.getSexo());
        jftfCpf.setText(h.getCpf());
        jtfRg.setText(h.getRg());
        jftfNasc.setText(h.getDtnascimento());
        jtfEmail.setText(h.getEmail());
        jtfNatural.setText(h.getNaturalidade());
        jtfNacion.setText(h.getNacionalidade());
        jcbEstadoCivil.setSelectedItem(h.getEstadocivil());
        jtfEnd.setText(h.getEndresid());
        jtfBairro.setText(h.getBairro());
        jftfCep.setText(h.getCep());
        jtfCidade.setText(h.getCidade());
        jcbUF.setSelectedItem(h.getUf());
        jftfTelCel.setText(h.getTelcel());
        jftfTelResid.setText(h.getTelresid());
        jtfProfiss.setText(h.getProfissao());
        jcbPossuiCarro.setSelectedItem(h.getPossuicarro());
        jftfPlaca.setText(h.getPlccar());
        jtfMM.setText(h.getMmcar());
        jtfApartamento.setText(h.getApt());
        jftfDataEnt.setText(h.getDtentrada());
        jftfDataSaida.setText(h.getDtsaida());
        jtfCor.setText(h.getCor());

    }

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new dadosHospede().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel61;
    private javax.swing.JLabel jLabel62;
    private javax.swing.JLabel jLabel63;
    private javax.swing.JLabel jLabel64;
    private javax.swing.JLabel jLabel65;
    private javax.swing.JLabel jLabel66;
    private javax.swing.JLabel jLabel67;
    private javax.swing.JLabel jLabel68;
    private javax.swing.JLabel jLabel69;
    private javax.swing.JLabel jLabel70;
    private javax.swing.JLabel jLabel71;
    private javax.swing.JLabel jLabel72;
    private javax.swing.JLabel jLabel73;
    private javax.swing.JLabel jLabel74;
    private javax.swing.JLabel jLabel75;
    private javax.swing.JLabel jLabel76;
    private javax.swing.JLabel jLabel77;
    private javax.swing.JLabel jLabel78;
    private javax.swing.JLabel jLabel79;
    private javax.swing.JLabel jLabel80;
    private javax.swing.JLabel jLabel81;
    private javax.swing.JLabel jLabel82;
    private javax.swing.JLabel jLabel83;
    private javax.swing.JLabel jLabel84;
    private javax.swing.JTabbedPane jTabbedPane4;
    private javax.swing.JButton jbAlterar;
    private javax.swing.JButton jbDeletar;
    private javax.swing.JButton jbSair;
    private javax.swing.JComboBox jcbEstadoCivil;
    private javax.swing.JComboBox jcbPossuiCarro;
    private javax.swing.JComboBox jcbSexo;
    private javax.swing.JComboBox jcbUF;
    private javax.swing.JFormattedTextField jftfCep;
    private javax.swing.JFormattedTextField jftfCpf;
    private javax.swing.JFormattedTextField jftfDataEnt;
    private javax.swing.JFormattedTextField jftfDataSaida;
    private javax.swing.JFormattedTextField jftfNasc;
    private javax.swing.JFormattedTextField jftfPlaca;
    private javax.swing.JFormattedTextField jftfTelCel;
    private javax.swing.JFormattedTextField jftfTelResid;
    private javax.swing.JPanel jpDadosHotelaria;
    private javax.swing.JPanel jpDadosPessoais4;
    private javax.swing.JPanel jpDadosProfissionais;
    private javax.swing.JPanel jpInformacoesAdicionais;
    private javax.swing.JTextField jtfApartamento;
    private javax.swing.JTextField jtfBairro;
    private javax.swing.JTextField jtfCidade;
    private javax.swing.JTextField jtfCor;
    private javax.swing.JTextField jtfEmail;
    private javax.swing.JTextField jtfEmpresa;
    private javax.swing.JTextField jtfEnd;
    private javax.swing.JTextField jtfMM;
    private javax.swing.JTextField jtfNacion;
    private javax.swing.JTextField jtfNatural;
    private javax.swing.JTextField jtfNome;
    private javax.swing.JTextField jtfProfiss;
    private javax.swing.JTextField jtfRg;
    // End of variables declaration//GEN-END:variables

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }
}
